﻿/**
 * @file NisObjectCommon_Struct.h
 * @brief ObjectCommonData
 * @details 
 * @mainpage http://www.navinfo.com/
 * @author Navinfo
 * @email 400-810-0880
 * @license Navinfo Co.,Ltd. All rights reserved
 */
#ifndef	__NISOBJECTCOMMONSTRUCT_H_
#define	__NISOBJECTCOMMONSTRUCT_H_

PRAGMA_PACK_PUSH

namespace Navinfo {
namespace Nis {

class CObjectSignContent;
class CTrafficLightDetails;
class CObjectLinkGeoRelationFlag;
class CObjectLinkGeoRelation;
class CLinkGeoObjectRelationFlag;
class CLinkGeoObjectRelation;
class CObjectLaneRelationFlag;
class CObjectLaneRelation;
class CLaneObjectRelationFlag;
class CLaneObjectRelation;
class CObjectGroup;
class CObjectGroupList;

/**
 * @brief OBJECT_SIGN_SHAPE
 * 
 */
enum OBJECT_SIGN_SHAPE {
	OBJECT_SIGN_SHAPE_TRIANGLE_TIP_UP = 0,	///<	三角
	OBJECT_SIGN_SHAPE_RECTANGLE = 1,	///<	矩形
	OBJECT_SIGN_SHAPE_ROUND = 2,	///<	圆
	OBJECT_SIGN_SHAPE_OCTAGON = 3,	///<	八角形
	OBJECT_SIGN_SHAPE_DIAMOND = 4,	///<	菱形
	OBJECT_SIGN_SHAPE_TRIANGLE_TIP_DOWN = 6,	///<	倒三角
	OBJECT_SIGN_SHAPE_OTHER = 8,	///<	其他
};
/**
 * @brief OBJECT_SIGN_TYPE
 * 
 */
enum OBJECT_SIGN_TYPE {
	OBJECT_SIGN_TYPE_NUMBER = 1,	///<	数字
};
/**
 * @brief GEOMETRY_TYPE
 * 
 */
enum GEOMETRY_TYPE {
	GEOMETRY_TYPE_POINT,	///<	点
	GEOMETRY_TYPE_CIRCLE,	///<	圆
	GEOMETRY_TYPE_RECTANGLE,	///<	矩形
};


/**
 * @brief 交通标牌内容
 * 
 */
class DLL_PUBLIC CObjectSignContent
{
public:
	CObjectSignContent();

	explicit CObjectSignContent(
		  const uint64 &m_ullNumber_
		);

public:
	/**
	 * @brief 取得Number
	 *
	 * @return 数字
	 */
	const uint64& GetNumber() const;


public:
	uint64														m_ullNumber;								///<	  数字  
};


/**
 * @brief 交通灯详细情报
 * 
 */
class DLL_PUBLIC CTrafficLightDetails
{
public:
	CTrafficLightDetails();

	explicit CTrafficLightDetails(
		  const uchar &m_ucOrientation_
		, const uchar &m_ucTierNum_ = 0
		, const uchar &m_ucLightNum_ = 0
		);

public:
	/**
	 * @brief 取得Orientation
	 *
	 * @return 交通灯方向。1=垂直，2=水平
	 */
	const uchar& GetOrientation() const;

	/**
	 * @brief 取得TierNum
	 *
	 * @return 交通灯层数。垂直方向：交通灯列数，水平方向：交通灯行数
	 */
	const uchar& GetTierNum() const;

	/**
	 * @brief 取得LightNum
	 *
	 * @return 每层灯泡数量。垂直方向：从上到下，水平方向：从左到右
	 */
	const uchar& GetLightNum() const;


public:
	uchar														m_ucOrientation;							///<	  交通灯方向。1=垂直，2=水平  
	uchar														m_ucTierNum;								///<	  交通灯层数。垂直方向：交通灯列数，水平方向：交通灯行数  
	uchar														m_ucLightNum;								///<	  每层灯泡数量。垂直方向：从上到下，水平方向：从左到右  
};


/**
 * @brief ObjectLinkGeoRelationFlag
 * 
 */
class DLL_PUBLIC CObjectLinkGeoRelationFlag
{
public:
	CObjectLinkGeoRelationFlag();

	explicit CObjectLinkGeoRelationFlag(
		uchar v_ 
		);

public:
	/**
	 * @brief 取得RangeFlag
	 * @details 
	 *
	 * @return 标识Range有无Flag
	 */
	Navinfo::Nis::BOOL GetRangeFlag() const;


public:
	union {
		uchar													v;
		struct {
			uchar												m_ucRangeFlag				: 1;			///<	  标识Range有无Flag  
		};
	};
};


/**
 * @brief 对象和LinkGeo关系记录
 * 
 */
class DLL_PUBLIC CObjectLinkGeoRelation
{
public:
	CObjectLinkGeoRelation();

	explicit CObjectLinkGeoRelation(
		  const CObjectLinkGeoRelationFlag &m_clFlag_
		, const Navinfo::Nis::CLinkGeoId &m_clLinkGeoId_ = Navinfo::Nis::CLinkGeoId()
		, const Navinfo::Nis::CLinearRange &m_clRange_ = Navinfo::Nis::CLinearRange()
		);

public:
	/**
	 * @brief 取得Flag
	 *
	 * @return Flag
	 */
	const CObjectLinkGeoRelationFlag& GetFlag() const;

	/**
	 * @brief 取得LinkGeoId
	 *
	 * @return LinkGeoId
	 */
	const Navinfo::Nis::CLinkGeoId& GetLinkGeoId() const;

	/**
	 * @brief 取得Range
	 *
	 * @return Range
	 */
	const Navinfo::Nis::CLinearRange& GetRange() const;


public:
	CObjectLinkGeoRelationFlag									m_clFlag;									///<	  Flag  
	Navinfo::Nis::CLinkGeoId									m_clLinkGeoId;								///<	  LinkGeoId  
	Navinfo::Nis::CLinearRange									m_clRange;									///<	  Range  
};


/**
 * @brief LinkGeoObjectRelationFlag
 * 
 */
class DLL_PUBLIC CLinkGeoObjectRelationFlag
{
public:
	CLinkGeoObjectRelationFlag();

	explicit CLinkGeoObjectRelationFlag(
		uchar v_ 
		);

public:
	/**
	 * @brief 取得RangeFlag
	 * @details 
	 *
	 * @return 标识Range是否有效的Flag
	 */
	Navinfo::Nis::BOOL GetRangeFlag() const;


public:
	union {
		uchar													v;
		struct {
			uchar												m_ucRangeFlag				: 1;			///<	  标识Range是否有效的Flag  
		};
	};
};


/**
 * @brief LinkGeo和对象关系记录
 * 
 */
class DLL_PUBLIC CLinkGeoObjectRelation
{
public:
	CLinkGeoObjectRelation();

	explicit CLinkGeoObjectRelation(
		  const CLinkGeoObjectRelationFlag &m_clFlag_
		, const Navinfo::Nis::CObjectId &m_clObjectId_ = Navinfo::Nis::CObjectId()
		, const Navinfo::Nis::CLinearRange &m_clRange_ = Navinfo::Nis::CLinearRange()
		);

public:
	/**
	 * @brief 取得Flag
	 *
	 * @return Flag
	 */
	const CLinkGeoObjectRelationFlag& GetFlag() const;

	/**
	 * @brief 取得ObjectId
	 *
	 * @return 关联对象的Id
	 */
	const Navinfo::Nis::CObjectId& GetObjectId() const;

	/**
	 * @brief 取得Range
	 *
	 * @return Range
	 */
	const Navinfo::Nis::CLinearRange& GetRange() const;


public:
	CLinkGeoObjectRelationFlag									m_clFlag;									///<	  Flag  
	Navinfo::Nis::CObjectId										m_clObjectId;								///<	  关联对象的Id  
	Navinfo::Nis::CLinearRange									m_clRange;									///<	  Range  
};


/**
 * @brief ObjectLaneRelationFlag
 * 
 */
class DLL_PUBLIC CObjectLaneRelationFlag
{
public:
	CObjectLaneRelationFlag();

	explicit CObjectLaneRelationFlag(
		uchar v_ 
		);

public:
	/**
	 * @brief 取得LaneRangeFlag
	 * @details 
	 *
	 * @return 标识LaneRange是否有效的Flag
	 */
	Navinfo::Nis::BOOL GetLaneRangeFlag() const;


public:
	union {
		uchar													v;
		struct {
			uchar												m_ucLaneRangeFlag			: 1;			///<	  标识LaneRange是否有效的Flag  
		};
	};
};


/**
 * @brief 对象和车道的关系记录
 * 
 */
class DLL_PUBLIC CObjectLaneRelation
{
public:
	CObjectLaneRelation();

	explicit CObjectLaneRelation(
		  const CObjectLaneRelationFlag &m_clFlag_
		, const Navinfo::Nis::CLaneId &m_clLaneId_ = Navinfo::Nis::CLaneId()
		, const Navinfo::Nis::CLinearRange &m_clLaneRange_ = Navinfo::Nis::CLinearRange()
		);

public:
	/**
	 * @brief 取得Flag
	 *
	 * @return Flag
	 */
	const CObjectLaneRelationFlag& GetFlag() const;

	/**
	 * @brief 取得LaneId
	 *
	 * @return 车道Id
	 */
	const Navinfo::Nis::CLaneId& GetLaneId() const;

	/**
	 * @brief 取得LaneRange
	 *
	 * @return LaneRange
	 */
	const Navinfo::Nis::CLinearRange& GetLaneRange() const;


public:
	CObjectLaneRelationFlag										m_clFlag;									///<	  Flag  
	Navinfo::Nis::CLaneId										m_clLaneId;									///<	  车道Id  
	Navinfo::Nis::CLinearRange									m_clLaneRange;								///<	  LaneRange  
};


/**
 * @brief LaneObjectRelationFlag
 * 
 */
class DLL_PUBLIC CLaneObjectRelationFlag
{
public:
	CLaneObjectRelationFlag();

	explicit CLaneObjectRelationFlag(
		uchar v_ 
		);

public:
	/**
	 * @brief 取得LaneRangeFlag
	 * @details 
	 *
	 * @return 标识LaneRange是否有效的Flag
	 */
	Navinfo::Nis::BOOL GetLaneRangeFlag() const;


public:
	union {
		uchar													v;
		struct {
			uchar												m_ucLaneRangeFlag			: 1;			///<	  标识LaneRange是否有效的Flag  
		};
	};
};


/**
 * @brief 车道和对象关联记录
 * 
 */
class DLL_PUBLIC CLaneObjectRelation
{
public:
	CLaneObjectRelation();

	explicit CLaneObjectRelation(
		  const CLaneObjectRelationFlag &m_clFlag_
		, const Navinfo::Nis::CObjectId &m_clObjectId_ = Navinfo::Nis::CObjectId()
		, const Navinfo::Nis::CLinearRange &m_clLaneRange_ = Navinfo::Nis::CLinearRange()
		);

public:
	/**
	 * @brief 取得Flag
	 *
	 * @return Flag
	 */
	const CLaneObjectRelationFlag& GetFlag() const;

	/**
	 * @brief 取得ObjectId
	 *
	 * @return 与车道关联的对象Id
	 */
	const Navinfo::Nis::CObjectId& GetObjectId() const;

	/**
	 * @brief 取得LaneRange
	 *
	 * @return LaneRange
	 */
	const Navinfo::Nis::CLinearRange& GetLaneRange() const;


public:
	CLaneObjectRelationFlag										m_clFlag;									///<	  Flag  
	Navinfo::Nis::CObjectId										m_clObjectId;								///<	  与车道关联的对象Id  
	Navinfo::Nis::CLinearRange									m_clLaneRange;								///<	  LaneRange  
};


/**
 * @brief 对象关联组
 * 
 */
class DLL_PUBLIC CObjectGroup
{
public:
	CObjectGroup();

	explicit CObjectGroup(
		  const vector< Navinfo::Nis::CObjectId > &m_vclObjectId_
		);

public:
	/**
	 * @brief 取得ObjectId的数量
	 *
	 * @return ObjectId的数量
	 */
	size_t GetNumObjectId() const;

	/**
	 * @brief 取得数组ObjectId中下标为iNo的元素
	 * @details 
	 *
	 * @return 对象Id
	 */
	const Navinfo::Nis::CObjectId& GetObjectId( size_t iNo ) const;

	/**
	 * @brief 取得ObjectId
	 *
	 * @return 对象Id
	 */
	const vector< Navinfo::Nis::CObjectId >& GetObjectId() const;


public:
	vector< Navinfo::Nis::CObjectId >							m_vclObjectId;								///<	  对象Id  
};


/**
 * @brief 对象关联组列表
 * 
 */
class DLL_PUBLIC CObjectGroupList
{
public:
	CObjectGroupList();

	explicit CObjectGroupList(
		  const vector< CObjectGroup > &m_vclObjectGroup_
		);

public:
	/**
	 * @brief 取得ObjectGroup的数量
	 *
	 * @return ObjectGroup的数量
	 */
	size_t GetNumObjectGroup() const;

	/**
	 * @brief 取得数组ObjectGroup中下标为iNo的元素
	 * @details 
	 *
	 * @return 对象关联组
	 */
	const CObjectGroup& GetObjectGroup( size_t iNo ) const;

	/**
	 * @brief 取得ObjectGroup
	 *
	 * @return 对象关联组
	 */
	const vector< CObjectGroup >& GetObjectGroup() const;


public:
	vector< CObjectGroup >										m_vclObjectGroup;							///<	  对象关联组  
};

}
}

PRAGMA_PACK_POP

#endif	//	__NISOBJECTCOMMONSTRUCT_H_
